package com.twu.biblioteca;

import sun.plugin2.main.client.ServiceDelegate;

import java.util.ArrayList;

public class Library {
    private ArrayList<Book> books;
    private ArrayList<Movie> movies;

    public Library() {
        books = new ArrayList<Book>();
        books.add(new Book("Old Man's War"));
        books.add(new Book("Harry Potter"));
        books.add(new Book("Dune"));

        movies = new ArrayList<Movie>();
        movies.add(new Movie("Godfather", "1972", "Coppola", "9/10"));
        movies.add(new Movie("UHF", "1989", "Levey", "7.5/10"));
        movies.add(new Movie("Up", "2009", "Docter", "10/10"));
        movies.add(new Movie("Goonies", "1985", "Donner", "9/10"));
        movies.add(new Movie("Elysium", "2013", "Blomkamp", "7/10"));
        movies.add(new Movie("District 9", "2009", "Blomkamp", "9/10"));
        movies.add(new Movie("Finding Nemo", "2003", "Unkrich", "8/10"));
        movies.add(new Movie("Children of Men", "2007", "Cuaron", "9/10"));
        movies.add(new Movie("Primer", "2004", "Carruth", "10/10"));
        movies.add(new Movie("Se7en", "1995", "Fincher", "8.5/10"));
        movies.add(new Movie("Cars", "2006", "Lasseter", "5/10"));
        movies.add(new Movie("Fargo", "1996", "Coen", "7.5/10"));
        movies.add(new Movie("Burn After Reading", "2008", "Coen", "7/10"));
        movies.add(new Movie("Forrest Gump", "1994", "Zemeckis", "7.5/10"));
        movies.add(new Movie("No Country For Old Men", "2007", "Coen", "8.5/10"));
    }

    public String bookExists(String name) {
        for (Book book : books) {
            if (book.getName().equals(name)) return "Thank you! Enjoy the book.";
        }
        return "Sorry we don't have that book yet.";
    }

    public ArrayList<Book> getBooks() {
        return books;
    }

    public ArrayList<Movie> getMovies() {
        return movies;
    }
}
